package com.yami.shop.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yami.shop.bean.model.ChannelUserRelationRecord;
import com.yami.shop.bean.vo.PersonNft;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Repository
public interface ChannelUserRelationRecordMapper extends BaseMapper<ChannelUserRelationRecord> {

    ChannelUserRelationRecord getinfoByUserIdChainCodeChannelCode(@Param("userId")String userId , @Param("chainCode")String chainCode, @Param("channelCode")String channelCode, @Param("type")String type);

    List<ChannelUserRelationRecord> getUserAllAddress(@Param("userId")String userId, @Param("chainCode")String chainCode, @Param("channelCode")String channelCode);
    ChannelUserRelationRecord getUserByChannelUserId(@Param("channelUserId")String channelUserId, @Param("chainCode")String chainCode, @Param("channelCode")String channelCode);
    ChannelUserRelationRecord getChannelAddressByaddress(@Param("address")String address, @Param("chainCode")String chainCode);
    //用户链下渠道列表
    List<Map<String,Object>> getUserHasChannelList(@Param("userId")String userId, @Param("chainCode")String chainCode);
    //用户渠道列表
    List<Map<String,Object>> getHomeChannelList(@Param("userId") String userId);
    List<Map<String,Object>> getHomeChainList(@Param("userId")String userId, @Param("channelCode")String channelCode);
    List<ChannelUserRelationRecord> getHomeChainRecordList(@Param("userId")String userId, @Param("channelCode")String channelCode);


    List<Map<String,Object>> allChannelList(@Param("chainCode")String chainCode);
    List<Map<String,Object>> userBlockchain(@Param("userId")String userId);

    Map<String,Object> getChainInfoByCode(@Param("chainCode")String chainCode);
    Map<String,Object> getChannelInfoByCode(@Param("channelCode")String channelCode);
    ChannelUserRelationRecord getLastChannel(@Param("userId") String userId);
    List<ChannelUserRelationRecord> getAllChannel(@Param("userId") String userId);
    void removeAddress(@Param("userId")String userId, @Param("chainCode")String chainCode, @Param("channelCode")String channelCode);

    /**
     * 要导入的列表
     * @param userId
     * @param chainCode
     * @param channelCode
     * @return
     */
    List<Map<String,Object>> getCreateUserChainChannelList(@Param("userId")String userId ,@Param("chainCode")String chainCode,@Param("channelCode")String channelCode,@Param("bigMan")Boolean bigMan );

    /**
     * 根据条件获取用户持仓数
     * @param personNft
     * @return
     */
    Integer getUserHoldNftCount(@Param("personNft") PersonNft personNft);
}
